from option import Option
import signals
import helpers
import stats
import gtk

def importFile(widget):
	type, resolution, period = helpers.createPeriodSelection()	

def importDB(widget):
	pass

def importManual(widget):
	pass

def exportFile(widget):
	pass

def exportDB(widget):
	pass

def init():
	menu = gtk.Menu()

	item = gtk.MenuItem(label = _('Import from file'))
	item.connect('activate',importFile)
	item.show()
	menu.append(item)

	item = gtk.MenuItem(label = _('Import from external database'))
	item.connect('activate',importDB)
	item.show()
	menu.append(item)

	item = gtk.MenuItem(label = _('Import manually'))
	item.connect('activate',importManual)
	item.show()
	menu.append(item)

	item = gtk.SeparatorMenuItem()
	item.show()
	menu.append(item)

	item = gtk.MenuItem(label = _('Export'))
	item.connect('activate',exportFile)
	item.show()
	menu.append(item)

	item = gtk.MenuItem(label = _('Backup database'))
	item.connect('activate',exportDB)
	item.show()
	menu.append(item)

	'''item = gtk.MenuItem(label = _(''))
	item.connect('activate',export)
	item.show()
	menu.append(item)'''


	menu.show()
	toolmenu = gtk.MenuItem(label = 'Import / Export')
	toolmenu.set_submenu(menu)
	toolmenu.show()

	Option().windowMain.menuTools.append(toolmenu)

def info():
	return {'name':'mod_imex',
			'author':'Michal Hordecki',
			'description':'Import and export your scores!',
			}

def teardown():
	pass

